{%extends "base.html"%}

{% block content %}
<div class="container py-5">
  <h3 class="pb-3 border-bottom">智能岗位推荐</h3>
  <form id="form" class="py-3" action="/recommend" method="POST">
    <div class="form-group">
      <label>学历</label>
      <select class="form-control" name="degree">
        <option value="">请选择学历</option>
        <option value="高中" {%if data%}{% if data.degree == '高中' %} selected {%endif%}{%endif%}>高中</option>
        <option value="大专" {%if data%}{% if data.degree == '大专' %} selected {%endif%}{%endif%}>大专</option>
        <option value="本科" {%if data%}{% if data.degree == '本科' %} selected {%endif%}{%endif%}>本科</option>
        <option value="硕士" {%if data%}{% if data.degree == '硕士' %} selected {%endif%}{%endif%}>硕士</option>
        <option value="博士" {%if data%}{% if data.degree == '博士' %} selected {%endif%}{%endif%}>博士</option>
      </select>
    </div>
    <div class="form-group">
      <label>工作经验</label>
      <input class="form-control" name="work_exp" placeholder="Enter work experience" {% if data %} value="{{data.work_exp}}" {%endif%}>
      <small class="form-text text-muted">请输入阿拉伯数字：0, 1, 2....</small>
    </div>
    <div class="form-group">
      <label>已具备的软硬件技能</label>
      <textarea class="form-control" rows="3" name="desc">{% if data %}{{data.desc}}{%endif%}</textarea>
      <small class="form-text text-muted">自由发挥，可填写如：java, sql, python....</small>
    </div>
    <div class="d-flex">
      <button type="submit" class="btn btn-primary ml-auto mr-5">智能推荐</button>
    </div>
  </form>

  {% if res_len %}
  <div class="card mt-4">
    <div class="card-header">
      推荐结果
    </div>
    <div class="card-body">
      {% for i in range(res_len) %}
      <div class="d-flex justify-content-between">
        <div class="mr-3">{{ res_list[i] }}</div>
        <div class="">
          {% for j in range(5 - i) %}
          <i class="fa fa-star" aria-hidden="true" style="color:#606c72;"></i>
          {% endfor %}
        </div>
      </div>
      {% endfor %}
    </div>
  </div>
  {% endif %}
</div>
{% endblock %}

{% block styles %}
<!-- 越后面加载，优先级越高 -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
{% endblock %}

{% block scripts %}
{% endblock %}